Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Test IPFS using ipfs-api with the same interface-ipfs-core tests #432

Merged
merged 7 commits into from
Aug 25, 2016

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Aug 23, 2016

WIP, solves #428

TODO:

  • factory-http
  • test-block
    • core
    • http
  • test-object
  • test-files
  • test-config
  • test-swarm
    • core
    • http

Notes:

Already finding problems just by reusing test-object, this was definitely a good idea :D

@daviddias daviddias added the status/in-progress In progress label Aug 23, 2016
@daviddias daviddias self-assigned this Aug 23, 2016
@daviddias
Copy link
Member Author

Needs (for swarm tests):

@daviddias
Copy link
Member Author

I want to go ahead and merge this one in, letting the files and swarm be inside of another PR, since they will require a bit more work across other modules, enabling me to focus back on the pull-stream endeavour.

@dignifiedquire would appreciate some review here. As said above, it is really great to reuse the same tests over js-ipfs-api, found a bunch of issues, this already made js-ipfs way more portable :)

@daviddias daviddias force-pushed the feat/interface-ipfs-core-over-ipfs-api-tests branch from 6f005cd to 168e04a Compare August 25, 2016 06:44
@daviddias daviddias force-pushed the feat/interface-ipfs-core-over-ipfs-api-tests branch 4 times, most recently from 257f6d0 to 1c4dec7 Compare August 25, 2016 07:30
@daviddias daviddias force-pushed the feat/interface-ipfs-core-over-ipfs-api-tests branch from 1c4dec7 to 44dba6c Compare August 25, 2016 07:30
@daviddias
Copy link
Member Author

@dignifiedquire have you CR'ed this one yet? All good?

stat: (hash, callback) => {
if (typeof hash === 'string') {
hash = multihash.fromB58String(hash)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a lot of duplication, would be nice to simplify this to something like this

const ensureHash = (hash) => {
  if (typeof hash === 'string') return multihash.fromB58String(hash)
  return hash
}

@dignifiedquire
Copy link
Member

LGTM

@daviddias daviddias force-pushed the feat/interface-ipfs-core-over-ipfs-api-tests branch from a478c0d to 4fce10f Compare August 25, 2016 10:39
@daviddias daviddias merged commit 5006129 into master Aug 25, 2016
@daviddias daviddias deleted the feat/interface-ipfs-core-over-ipfs-api-tests branch August 25, 2016 14:39
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this pull request May 22, 2020
When running the tests I got errors like this:

    Error: error:140AB18E:SSL routines:SSL_CTX_use_certificate:ca md too weak

In order to fix this I created a new certificate. I thought 100 years of
validity might be enough. The command to create it was (based on
https://letsencrypt.org/docs/certificates-for-localhost/):

    openssl req -x509 -out cert.pem -keyout privkey.pem \
      -newkey rsa:2048 -nodes -sha256 \
      -subj '/CN=localhost' -extensions EXT -config <( \
       printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") \
      -days 36524

To verify, run from within *js-ipfs*:

    npx mocha test/core/interface.spec.js --grep 'should add from a HTTPS URL'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants